package com.frogs.ucenter.v1.request;

import javax.servlet.http.HttpServletRequest;

import com.frogs.framework.web.HttpRequestInfo;
import com.frogs.system.util.ApiUrlParamEnum;
import com.frogs.system.web.api.request.Request;
import com.frogs.system.web.exception.RequestIllegalException;

public class FollowedBaseInfoRequest extends Request {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5206464148251015903L;

	private int userId;
	public int getUserId() {
		return userId;
	}
	public void setUserId(int userId) {
		this.userId = userId;
	}
	@Override
	public void parse(HttpServletRequest request) {
		HttpRequestInfo requestInfo = new HttpRequestInfo(request);
		this.userId = requestInfo.getIntParameter(ApiUrlParamEnum.userId.getParamName(), -1);
		if(userId <= 0) {
			throw new RequestIllegalException("缺少用户id！");
		}
	}
}
